package UnOfficeDeTourisme;

/**
 * Interface definition : Catalogue
 * 
 * @author OpenORB Compiler
 */
public abstract class CataloguePOA extends org.omg.PortableServer.Servant
        implements CatalogueOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Catalogue _this()
    {
        return CatalogueHelper.narrow(_this_object());
    }

    public Catalogue _this(org.omg.CORBA.ORB orb)
    {
        return CatalogueHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/Catalogue:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("_get_idCatalogue")) {
                return _invoke__get_idCatalogue(_is, handler);
        } else if (opName.equals("_get_listeDesPrestations")) {
                return _invoke__get_listeDesPrestations(_is, handler);
        } else if (opName.equals("_get_nomCatalogue")) {
                return _invoke__get_nomCatalogue(_is, handler);
        } else if (opName.equals("ajouterPresta")) {
                return _invoke_ajouterPresta(_is, handler);
        } else if (opName.equals("listerPresta")) {
                return _invoke_listerPresta(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke__get_idCatalogue(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg = idCatalogue();
        _output = handler.createReply();
        _output.write_long(arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke__get_nomCatalogue(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg = nomCatalogue();
        _output = handler.createReply();
        _output.write_string(arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke__get_listeDesPrestations(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.Prestation[] arg = listeDesPrestations();
        _output = handler.createReply();
        UnOfficeDeTourisme.listePrestationsHelper.write(_output,arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_ajouterPresta(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.Prestation arg0_in = UnOfficeDeTourisme.PrestationHelper.read(_is);

        ajouterPresta(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_listerPresta(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        UnOfficeDeTourisme.Prestation[] _arg_result = listerPresta();

        _output = handler.createReply();
        UnOfficeDeTourisme.listePrestationsHelper.write(_output,_arg_result);

        return _output;
    }

}
